// 字典接口
var express = require("express");
var router = express.Router();
var DB = require('../../database/index')
const { readFile, writeFile, mkdir, readdirSync } = require("fs");

// 获取文件夹名称列表
router.get('/getFilesList',(req,res,next)=>{
    let dirList = readdirSync("./json/nav/files");
    res.send(dirList)
})
// 获取分类列表
router.get('/getClassList',(req,res,next)=>{
    if(!req.body){
        res.error('参数错误')
    }
    const sql = 'select * from  user_info'
    DB.query(sql,(err,result)=>{
        console.log(err,result,'123333')
        res.send(result)
    })
})


router.get('/',function(req, res, next) {
    res.render('index', { title: 'Express' });
})


module.exports = router;
